//
//  NSDate+FormatterString.m
//  SmartPram
//
//  Created by Kendama on 2017/11/8.
//  Copyright © 2017年 Kendama. All rights reserved.
//

#import "NSDate+FormatterString.h"

@implementation NSDate (FormatterString)

+(NSString *)getDateWithStringSince1970ToSecond:(NSString *)string stringDateFormatter:(NSString *)formatterStr
{
    NSDateFormatter *stampFormatter = [[NSDateFormatter alloc] init];
    [stampFormatter setDateFormat:formatterStr];
    NSDate *stampDate2 = [NSDate dateWithTimeIntervalSince1970:[string integerValue]];
    NSString *date = [stampFormatter stringFromDate:stampDate2];
    return date;
}

+ (NSString *)getDateWithDate:(NSDate *)date stringDateFormatter:(NSString *)formatterStr
{
    NSDateFormatter *stampFormatter = [[NSDateFormatter alloc] init];
    [stampFormatter setDateFormat:formatterStr];
    NSString *string = [stampFormatter stringFromDate:date];
    return string;
}

@end
